#include <stdio.h>
#include <signal.h>

volatile int g_val=0;

void handler(int signum)
{
    (void)signum;
    printf("将g_val,从%d->%d\n",g_val,1);
    g_val=1;
}
int main()
{
   signal(SIGINT,handler);

    while(!g_val);
    
    printf("process quit normal!\n");
    return 0;
}